package com.artist.service.Impl;

import com.artist.entity.TbBanner;
import com.artist.mapper.BannerMapper;
import com.artist.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("bannerService")
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerMapper bannerMapper;

    @Override
    public List<TbBanner> selectAll() {
        return bannerMapper.selectAll();
    }

    @Override
    public void savaBanner(TbBanner tbBanner) {
        bannerMapper.insertSelective(tbBanner);
    }

    @Override
    public void updateBannerByPrimaryKey(TbBanner tbBanner) {
        bannerMapper.updateByPrimaryKeySelective(tbBanner);

    }

    @Override
    public TbBanner selectBannerByPrimaryKey(Integer bId) {
        return bannerMapper.selectByPrimaryKey(bId);
    }

    @Override
    public void deleteBnanerByPrimaryKey(Integer bId) {
        bannerMapper.deleteByPrimaryKey(bId);
    }
}
